#include "bsp_encoder.h"
#include "tim.h"
#include "stdio.h"

int get_left_speed()
{
	int counter=__HAL_TIM_GET_COUNTER(&htim2);
	__HAL_TIM_SetCounter(&htim2,0);
	 counter = 1001-counter;
	if(counter > 500)
	{
		counter = counter -1001;
	}
	return counter;
}

int get_right_speed()
{
	int counter=__HAL_TIM_GET_COUNTER(&htim3);
	__HAL_TIM_SetCounter(&htim3,0);
	if(counter > 500)
	{
		counter = counter -1001;
	}
	return counter;
}

